#include <iostream>
#include <signal.h>
#include <stdlib.h>
#include <cstring>
#include <unistd.h>
using namespace std;

void handler(int signno){
    cout<<"get a signal:"<<signno<<endl;
}
void Usage(std::string proc){
    cout<<"\tUsage:\n\t";
    cout<<proc<<"信号编号 目标进程\n"<<endl;
}
int main(int argc,char* argv[]){
    // signal(3,handler);
    // while(true){
    //     sleep(1);
    //     raise(3);
    // }
    if(argc!=3){
        Usage(argv[0]);
        exit(1);
    }
    int n = kill(atoi(argv[2]),atoi(argv[1]));
    if(n!=0)
    {
        cerr<<errno<<":"<<strerror(errno)<<endl;
        exit(2);
    }
    return 0;
}